//================v1要点总结===============

/**
 * 
 * 1. 最简单的，用标记的方法
 */

/**
 * @param {number[]} nums
 * @return {number}
 */
var singleNumber = function (nums) {
    let map = {}
    for (let i = 0; i < nums.length; i++) {
        if (map[nums[i]] === undefined) {
            map[nums[i]] = nums[i]
        } else {
            map[nums[i]] = 0
        }
    }
    return Object.keys(map).reduce((pre, cur) => {
        return pre + map[cur]
    }, 0)
};

console.log(singleNumber([2, 2, 3]))